<?php
/***************************************************************
*  Copyright notice
*  (c) 2007, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the MyGodaddy project.
***************************************************************/

//
set_time_limit(0);

//
$_root = str_replace('\\', '/', dirname(dirname(__FILE__))) . '/';
$dir = 'images/A/PhotoRS/';
$dir = 'templates/default/admin/blocks/zh_cn/';

//
include($_root . 'includes/utils.php');
include($_root . 'includes/classes/core.directory.class.php');
$dirObj = new CoreDirectoryParser('', $dir, $_root);
$dirObj->parse();
$dirs = $dirObj->getDirs();
$files = $dirObj->getFiles();
$real_dir = $dirObj->getRealDir();

//
if( is_array($files) ) {
	for($i=0, $n=sizeof($files); $i<$n; $i++) {
		if( file_exists($real_dir . $files[$i]['file']) && strstr($files[$i]['file'], 'member_block_status_') ) {
			$filename = str_replace("member_block_status_", "admin_block_member_status_", $files[$i]['file']);
			
			if( !file_exists($real_dir . $filename) ) {
				rename($real_dir . $files[$i]['file'], $real_dir . $filename);
			}
			//if( !file_exists(dirname($real_dir) . '/' . $filename) ) {
			//	copy($real_dir . $files[$i]['file'], dirname($real_dir) . '/' . $filename);
			//}
			echo $filename;
			echo '<br>';
		} else {
			
		}
	}
}
echo 'SUCCESS';
//
?>